﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Template.Master" Inherits="System.Web.Mvc.ViewPage<JLL.China.Web.Areas.Portal.Models.PortalModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%--<!--  start page-heading -->
    <div id="page-heading">
        <h1>
            Manage Article: Create new
        </h1>
    </div>--%>
    <div class="menu-nav">
        <%Html.RenderPartial("../Content/TopMenu");%>
    </div>
    <!-- end page-heading -->
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <img src="<%=Url.Content("~/Content/images/shared/side_shadowleft.jpg")%>" width="20"
                    height="300" alt="" />
            </th>
            <th class="topleft">
            </th>
            <td id="tbl-border-top">
                &nbsp;
            </td>
            <th class="topright">
            </th>
            <th rowspan="3" class="sized">
                <img src="<%=Url.Content("~/Content/images/shared/side_shadowright.jpg")%>" width="20"
                    height="300" alt="" />
            </th>
        </tr>
        <tr>
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner ...................................................................... START -->
                <div id="content-table-inner">
                    <% Html.RenderPartial("Measage");%>
                    <!--  start step-holder -->
                    <div id="step-holder">
                        <div class="step-no">
                            1</div>
                        <div class="step-dark-left">
                            Article Details</div>
                        <%--<div class="step-dark-right">
                            &nbsp;</div>
                        <div class="step-no-off">
                            2</div>
                        <div class="step-light-left">
                            Side Content</div>
                        <div class="step-light-round">
                            &nbsp;</div>--%>
                        <div class="clear">
                        </div>
                    </div>
                    <!--  end step-holder -->
                    <%Html.RenderPartial("../Content/Form", this.Model); %>
                </div>
                <!--  end table-content  -->
              </td>
            <td id="tbl-border-right"/>
        
         </tr>
         <tr>
            <th class="sized bottomleft">
            </th>
            <td id="tbl-border-bottom">
                &nbsp;
            </td>
            <th class="sized bottomright">
            </th>
        </tr>
     </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CSS" runat="server">
    <link href="<%=Url.Content("~/Scripts/qtip2/jquery.qtip.min.css") %>" rel="stylesheet"
        type="text/css" />
    <link href="<%=Url.Content("~/Scripts/jquery.validation/validationEngine.jquery.css")%>"
        rel="stylesheet" type="text/css" />
        <link href="<%=Url.Content("~/Content/css/mod-listing.css")%>" rel="stylesheet" type="text/css" />
    <link href="<%=Url.Content("~/Scripts/chosen/chosen.css")%>" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JS" runat="server">

    <script src="<%=Url.Content("~/Scripts/jquery.validation/jquery.validationEngine-en.js")%>"
        type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/jquery.validation/jquery.validationEngine.js")%>"
        type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/chosen/chosen.jquery.min.js")%>" type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/qtip2/jquery.qtip.min.js")%>" type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/jquery.validation/jquery.validate.js")%>"
        type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/ckeditor/ckeditor.js")%>" type="text/javascript"></script>

    <script type="text/javascript" src="<%=Url.Content("~/Scripts/ckeditor/adapters/jquery.js")%>"></script>

    <script type="text/javascript">
        function slugString(str) {

            var dname_without_space = str.replace(/ /g, "-");
            var name_without_special_char = dname_without_space.replace(/[^a-zA-Z 0-9]+/g, "-");
            return name_without_special_char;
        }

        /*function readURL(input) {
            /*if (input.file && input.files[0]) {
                var reader = new window.FileReader();

                reader.onload = function(e) {
                    $('#imgPreview')
                        .attr('src', e.target.result);
                };


                reader.readAsDataURL(input.files[0]);
                }
            }#1#
            var field = document.getElementById("imgPreview");
            field.src = input.value;
        }*/

        function checkForm() {
            $(document).ready(function() {
           
                if ($('#summary').val().length > 3) {
                    $('#summary_validate').val('ok');
                }
                else {
                    $('#summary_validate').val('');
                }
                //alert($('#contentID').val().length);
                if ($('#contentID').val().length > 3) {
                    $('#content_validate').val('ok');
                }
                else {
                    $('#content_validate').val('');
                }


                if ($('#summary_local').val().length > 3) {
                    $('#summary_local_validate').val('ok');
                }
                else {
                    $('#summary_local_validate').val('');
                }

                if ($('#content_local').val().length > 3) {
                    $('#content_local_validate').val('ok');
                }
                else {
                    $('#content_local_validate').val('');
                }

            });

        }
        $(document).ready(function() {

            $('.ckeditors').ckeditor({
                customConfig: BASE_URL + '/Scripts/ckeditor/config.js'
            });

            jQuery("#formID").validationEngine({
                prettySelect: true,
                useSuffix: "_chzn",
                promptPosition: "topLeft", 
                scroll: false
            });

            $(".chzn-nosearch").chosen({ disable_search_threshold: 3 });
            //End Data
            $(".chosen-select").chosen({
                allow_single_deselect: true
            });
            $("#title").keyup(function() {
                var val = $(this).val();
                $("#slug").val(slugString(val));
            });
        });
    </script>

</asp:Content>
